<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
%>
<html>
<head>
    <title>寻亲启事</title>
    <link rel="stylesheet" href="<%=path%>/web/userinfo/css/log.css">
    <link rel="stylesheet" href="<%=path%>/web/userinfo/css/page.css">
</head>
<body>
<div class="make_head_title">寻亲启事
</div>
<br>
<div class="manage-jobs">
    <div class="single-manage-jobs table-responsive">

    </div>
</div>
<script src="<%=path %>/web/static/js/modules/jquery-3.4.1.min.js"></script>
<script src="<%=path %>/web/static/layui/layui.all.js"></script>
</body>
</html>
<script>
    $(function () {
        initData(1);


        $(".single-manage-jobs").on("click", ".meneame a", function () { //给页码加点击事件
            var pageNum = $(this).data("id");
            initData(pageNum);
            return false;
        })


        $(".single-manage-jobs").on("click", "a.delete", function () {             //删除寻亲启事
            var informationId = $(this).data("id");
            layer.confirm("确认删除寻亲启事吗，删除后不可恢复", { title: "删除确认",btn: ['确认', '取消'] }, function (index) {
                layer.close(index);
                $.get("${pageContext.request.contextPath}/web/userinfo/deleteByInformationId",{informationId:informationId},function () {
                    initData(1);
                    layer.msg('删除成功', {icon: 5});
                })
            });
        });


        $(".single-manage-jobs").on("click", "a.find", function () {             //查找相似
            var informationId = $(this).data("id");
            layer.open({
                type:2,
                title: '相似启事',
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['800px', '800px'],
                content: "<%=path %>/web/information/likeList?informationId="+informationId
            });

        });
    })


    function initData(pageNum) {   //发布任务页面初始化
        var pageNum = {pageNum: pageNum};
        $.get("${pageContext.request.contextPath}/web/userinfo/findPersonList", pageNum, function (mes) {
                $(".single-manage-jobs").empty();
                $(".single-manage-jobs").html(mes);
            }
        );
    }
</script>